package personal.domain.accounting;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table (name="income_transaction")
public class IncomeTransaction implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long txnId;
	private Long entityId;
	private Long accountId;
	private BigDecimal amount;
	private Long txnDay;
	private Long txnMonth;
	private Long txnYear;
	private ExternalEntity entity;
	
	@Id
	@GeneratedValue (strategy=GenerationType.AUTO)
	@Column (name="txn_id", unique=true, length=11, nullable=false, insertable=true, updatable=false)
	public Long getTxnId() {
		return txnId;
	}
	public void setTxnId(Long txnId) {
		this.txnId = txnId;
	}
	@Column (name="entity_id", unique=false, length=11, nullable=true, insertable=true, updatable=true)
	public Long getEntityId() {
		return entityId;
	}
	public void setEntityId(Long entityId) {
		this.entityId = entityId;
	}
	@Column (name="account_id", unique=false, length=11, nullable=true, insertable=true, updatable=true)
	public Long getAccountId() {
		return accountId;
	}
	public void setAccountId(Long accountId) {
		this.accountId = accountId;
	}
	@Column (name="amount", unique=false, nullable=false, insertable=true, updatable=true)
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	@Column (name="txn_day", unique=false, length=11, nullable=false, insertable=true, updatable=true)
	public Long getTxnDay() {
		return txnDay;
	}
	public void setTxnDay(Long txnDay) {
		this.txnDay = txnDay;
	}
	@Column (name="txn_month", unique=false, length=11, nullable=false, insertable=true, updatable=true)
	public Long getTxnMonth() {
		return txnMonth;
	}
	public void setTxnMonth(Long txnMonth) {
		this.txnMonth = txnMonth;
	}
	@Column (name="txn_year", unique=false, length=11, nullable=false, insertable=true, updatable=true)
	public Long getTxnYear() {
		return txnYear;
	}
	public void setTxnYear(Long txnYear) {
		this.txnYear = txnYear;
	}
	
	@Transient
	public ExternalEntity getEntity() {
		return entity;
	}
	
	public void setEntity(ExternalEntity entity) {
		this.entity = entity;
	}
}
